import { Request } from "./index";

class api {
  // 登录
  public static getTest = {
    gener: (obj:any) =>
      Request.post("/auth/login", {
        username: obj.username,
        password: obj.password,
      }),
  };
  // 注册
  public static getRegister = {
    gener: (obj:any) =>
      Request.post("/auth/register", {
        username:obj.username,
        password: obj.password,
        againpwd: obj.password,
      })
  };
  // 广告
  public static trip = {
    gener: () => Request.get("/rest/travelList"),
  };
  // 订单
  public static orderList = {
    gener: () =>
      Request.post("/rest/orderList", {
        
        count: 0,
        status: 0,
       
      }),
  };
  // 热门城市
  public static cities = {
    gener: () =>
      Request.get("/rest/cities?_1666060414298"),
  };
  // 常用乘客
  public static passengers = {
    gener: () =>
      Request.post("/rest/passengers"),
  };
  // 车票
  public static query = {
    gener: (haveTicket,highSpeed,timeSort) =>
      Request.post("/rest/query",{
        date:"1666518142124",
        timeSort:timeSort,
        haveTicket:haveTicket,
        highSpeed:highSpeed,
        from:'天津',
        to:'上海'
      }),
  };
  // 选座
  public static moment = {
    gener: () =>
      Request.get("/rest/ticket"),
  };
}

export { api };
